//用来封装所有localStorage的操作

const Token_Key = 'token-my-geek-pc'

/**
 * 保存token
 * @param {*} token
 * @returns
 */
export const setToken = (token) => localStorage.setItem(Token_Key, token)

/**
 * 获取token
 * @returns
 */
export const getToken = () => localStorage.getItem(Token_Key)

/**
 * 移除token
 * @returns
 */
export const removeToken = () => localStorage.removeItem(Token_Key)

/**
 * 判断是否有token
 * @returns
 */
export const hasToken = () => !!getToken()
